/**
 * 
 */
package com.easidea.tim.entity.finance;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.springside.core.dao.extend.Undeletable;

import com.easidea.tim.entity.BaseEntity;
import com.easidea.tim.entity.purchase.PurchaseOrder;
import com.easidea.tim.entity.system.orgnization.Staff;

/**
 * 应付支付记录
 * @author Harrison
 *
 */
@Entity(name="tim_finance_shouldpay_clean_record")
@org.hibernate.annotations.Entity(dynamicInsert=true, dynamicUpdate=true)
@Cache(region="tim_finance_shouldpay_clean_record", usage=CacheConcurrencyStrategy.READ_WRITE)
@Undeletable(status="deleted")
public class ShouldPayCleanRecord extends BaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 6569567058842992270L;
	
	private Double amount;
	private Date payDate;
	private Staff cashier;
	private String memo;
	private ShouldPay shouldPay;
	private PurchaseOrder order; //采购单
	/**
	 * @return the amount
	 */
	@Column(name="amount", nullable=false, columnDefinition="double not null default 0")
	public Double getAmount() {
		return amount;
	}
	/**
	 * @param amount the amount to set
	 */
	public void setAmount(Double amount) {
		this.amount = amount;
	}
	/**
	 * @return the payDate
	 */
	@Temporal(TemporalType.DATE)
	@Column(name="pay_date", nullable=false)
	public Date getPayDate() {
		return payDate;
	}
	/**
	 * @param payDate the payDate to set
	 */
	public void setPayDate(Date payDate) {
		this.payDate = payDate;
	}
	/**
	 * @return the cashier
	 */
	@ManyToOne(cascade=CascadeType.MERGE)
	@JoinColumn(name="cashier_id",nullable=false)
	public Staff getCashier() {
		return cashier;
	}
	/**
	 * @param cashier the cashier to set
	 */
	public void setCashier(Staff cashier) {
		this.cashier = cashier;
	}
	/**
	 * @return the memo
	 */
	@Column(name="memo")
	public String getMemo() {
		return memo;
	}
	/**
	 * @param memo the memo to set
	 */
	public void setMemo(String memo) {
		this.memo = memo;
	}
	@ManyToOne(cascade=CascadeType.MERGE)
	@JoinColumn(name="purchase_order_id")	
	public PurchaseOrder getOrder() {
		return order;
	}
	public void setOrder(PurchaseOrder order) {
		this.order = order;
	}
	@ManyToOne(cascade=CascadeType.MERGE)
	@JoinColumn(name="shouldPay_id")		
	public ShouldPay getShouldPay() {
		return shouldPay;
	}
	
	public void setShouldPay(ShouldPay shouldPay) {
		this.shouldPay = shouldPay;
	}

}
